﻿@using E5_KhuyenMaiVang.Models;
@model IEnumerable<E5_KhuyenMaiVang.Models.VOUCHER>

@{
    ViewBag.Title = "VoucherHistory";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var StatusItems = ViewBag.StatusItems;
}


    <div id="random_deal">
	<div class="title-content"> </div>
	<table width="100%" border="0">
	  <tr>
	    <td width="40%"><div class="title-content">Lịch sỬ mua hÀng </div></td>
	    </tr>
	  <tr>
	    <td width="40%">
        <small>Tình trạng:</small>
        <form method="post" action="@Url.Action("SortedVoucherHistory", "Member")">
        	<select size="1" id="select" name="id" onchange="this.form.submit()">
                <option value="0">Tất cả</option>
                @foreach (var item in StatusItems)
                {
        		<option value="@item.StatusID">@item.StatusName</option>
                }                
        	</select> 
            </form>
            
        </td>
	    </tr>
	  <tr>
	    <td><small>Trang:</small> : <a href="#" style="text-decoration:none ; color:#333; font-weight:bold ;">1</a> <a href="#" style="text-decoration:none ; color:#333; font-weight:bold ; ">2</a></td>
	    </tr>
	  </table>
	<table width="791" style="border:1px #333 solid ; border-collapse:collapse; border-spacing: 0px;">
	  <tr> 
        <td width="5%" align="center" class="namecolumn" scope="col">STT</td>
	    <td width="31%" align="center" class="namecolumn" scope="col">Deal</td>
	    <td width="6%"align="center" class="namecolumn" scope="col">Số lượng</td>
	    <td width="31%"align="center" class="namecolumn" scope="col">Ngày mua</td>
	    <td width="27%"align="center" class="namecolumn" scope="col">Tình trạng </td>
	    </tr>
        @if (Model != null)
        {            
            int nVoucher = Model.Count();
            for(int i = 0; i<nVoucher; i++)
            {
                VOUCHER item = Model.ElementAt(i);
                DEAL deal = item.DEAL;                
	  <tr  style="border-bottom:2px #666 solid;">
        <td align="center" class="rowcolumn">@(i+1)</td>
	    <td align="center" class="rowcolumn"><a href="@Url.Action("Detail", "Produce", new { dealID = @deal.DealID })">@deal.DealName</a></td>
	    <td align="center" class="rowcolumn">1</td>
	    <td align="center" class="rowcolumn">@item.PurchaseDate</td>
	    <td align="center" class="rowcolumn"><b style="color:#97C30A">@item.VOUCHER_STATUS.StatusName</b></td>
	    </tr>
            }	       
        }
	  </table>
    </div>
    <table width="100%"></table>
   